package com.rimi.service;

import com.rimi.bean.YqzcOrder;
import com.rimi.commons.CommonResult;
import com.rimi.model.dto.GoodsListDto;
import com.rimi.model.dto.OrderGoodsDto;
import com.rimi.model.vo.PaymentVo;
import com.rimi.model.vo.RefundVo;

import java.util.Date;
import java.util.List;

/**
 * @author luka
 * @version V1.0
 * @date 2021 2021/7/7 0007 11:50
 */
public interface OrderService {
    /**
     * 添加订单
     * @param userId 用户id
     * @param goodId 商品id
     * @param goodQuantity 商品数量
     * @return
     */
    CommonResult addOrder(Integer userId,Integer goodId,Integer goodQuantity);

    /**
     * 根据订单状态查询订单
     * @param userId 用户id
     * @param function 订单状态
     * @return
     */
    List<OrderGoodsDto> orderGoods(Integer userId,String function);

    /**
     * 确认付款，订单状态变为待收货
     * @param orderNum 订单id
     * @param tradeNo 支付宝订单号
     * @param paymentTime 付款时间
     * @param paymentPrice 付款金额
     * @return
     */
    CommonResult paid(String orderNum, String tradeNo, Date paymentTime,Double paymentPrice,String defaultAddressInfo);

    /**
     * 根据订单id查询订单
     * @param orderId 订单Id
     * @return
     */
    PaymentVo findOrderByOrderId(Integer orderId,Integer userId);
    /**
     * 根据订单id查询订单
     * @param orderId
     * @return
     */
    RefundVo findOrderRefundByOrderId(Integer orderId,Integer userId);

    /**
     * 修改订单退款状态为退款中，并修改退款类型，金额，原因，图片
     * @param refundVo
     * @return
     */
    int updateRefundOrderStatusForDuring(RefundVo refundVo);

    /**
     * 修改订单退款状态为退款成功
     * @param refundVo
     * @return
     */
    int updateRefundOrderStatusForSuccess(RefundVo refundVo);

    /**
     * 确认收货，订单状态变为待评价
     * @param orderId
     * @return
     */
    CommonResult received(Integer orderId);

    /**
     * 取消订单，订单状态变为已取消
     * @param orderId
     * @return
     */
    CommonResult cancelOrder(Integer orderId);

    /**
     * 确认收货，订单状态变为已收货,
     * @param orderId
     * @return
     */
    CommonResult evaluated(Integer orderId);
    /**
     * 修改订单退款状态为退款失败
     * @param refundVo
     * @return
     */
    int updateRefundOrderStatusForFail(RefundVo refundVo);
}
